<template>
	<view>
		<!-- agree -->
		<view class="agree">
			<view>
				<image class="agreeBtn" src="https://yun.qiongtuyule.com/static/img/notice/agree.png" @click="toggleAgree" v-if="agree" mode="">
				</image>
				<image class="agreeBtn" src="https://yun.qiongtuyule.com/static/img/notice/noAgree.png" @click="toggleAgree" v-else mode="">
				</image>
			</view>
			<view>
				我已阅读并同意 <text class="marking" @tap="toUser()">《用户协议》</text>和<text class="marking" @tap="toPrivate()">《隐私协议》</text>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				agree: false
			}
		},
		onShow() {

		},
		onLoad() {

		},
		methods: {
			toPrivate(){
				uni.navigateTo({
					url:"/pages/my/privacy"
				})
			},
			toUser(){
				uni.navigateTo({
					url:"/pages/my/agreement"
				})
			},
			toggleAgree() {
				this.agree = !this.agree
				this.$emit('agreeChange', this.agree);
			}
		}
	}
</script>

<style lang="less" scoped>
	.agree {
		position: absolute;
		bottom: 60rpx;
		left: 0;
		right: 0;
		display: flex;
		align-items: center;
		font-size: 26rpx;
		color: #A5A5A5;
		justify-content: center;

		.agreeBtn {
			padding-right: 13rpx;
			width: 29rpx;
			height: 29rpx;
			display: flex;
			align-items: center;
		}

		.marking {
			color: #000000;
		}
	}
</style>